﻿using System;

namespace Exchange
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("amount: ");
            decimal fromMoney = int.Parse(Console.ReadLine());

            Console.Write("Currency: ");
            string currency = Console.ReadLine();

            //decimal toMoney = Echange(fromMoney, currency/*, "AMD"*/);

            try
            {
                decimal toMoney = Echange(fromMoney, currency/*, "AMD"*/);
                Console.WriteLine("Result: " + toMoney + "AMD");
            }
            catch
            {
                Console.WriteLine("Unknown Currency");
            }


            //Console.WriteLine("Result: " + toMoney + "AMD");

            Console.ReadKey();
        }

        static decimal Echange(decimal amount, string from/*, string to*/)
        {
            decimal rate;

            switch (from.ToUpper())
            {
                case "USD":
                    rate = 479.9m;
                    break;
                case "EUR":
                    rate = 520m;
                    break;
                case "RUR":
                    rate = 7.50m;
                    break;
                default:
                    //rate = 1;
                    throw new Exception();
                    break;
            }

            return amount * rate;
        }
    }
}
